home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today - The Disc! 5
/
CD-ROM Today - The Disc (Issue 5)(November 1994).ISO
/
mac
/
Mac shareware
/
Education
/
RLaB
/
rlib
/
redit.r
< prev
next >
Wrap
Text File
|
1994-09-21
|
1KB
|
42 lines
//-------------------------------------------------------------------
// Syntax: redit ( F , editor )
// Description:
// The redit function is a convenient way to edit an rfile, and have
// it automatically re-loaded upon exiting the editor. The argument F
// is a string, and is the name of the rfile (including the extension).
// The file must be in the present working directory to function
// properly.
// The second string argument is optional, and specifies an editor
// other than the default (vi).
//------------------------------------------------------------------
redit = function ( file , editor )
{
local (ED, r);
if (class (file) != "string")
{
error ("1st argument to edit() must be string");
}
if (!exist (editor))
{
ED = "vi";
else
if (class (editor) != "string")
{
error ("2nd argument ot edit() must be string");
}
ED = editor;
}
system (ED + " " + file);
r = load (file);
printf ("edited and loaded rfile: %s\n", file);
return r;
};